package com.itheima.edu.info.manager.dao;

import com.itheima.edu.info.manager.domain.Teacher;

import java.util.ArrayList;

public class TeacherDao {
    private static ArrayList<Teacher> listTea = new ArrayList<>();

    // 返回集合
    public ArrayList<Teacher> findAllTeacher(){
        return listTea;
    }

    // 添加老师
    public boolean addTeacher(Teacher addTea) {
        listTea.add(addTea);
        return true;
    }

    // 解雇老师
    public void deleteTeacherById(int index) {
        listTea.remove(index);
    }
    // 修改老师
    public void updateTeacher(int index, Teacher teacher) {
        listTea.set(index,teacher);
    }
}
